<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <link rel="shortcut icon" href="favicon.ico">
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{/css/font-awesome.min.css}" rel="stylesheet">
    <link th:href="@{/css/animate.css}" rel="stylesheet">
    <link rel="stylesheet" type="text/css" th:href="@{/css/plugins/webuploader/webuploader.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/webuploader/webuploader-demo.css}">
    <link th:href="@{/css/style.css}" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <small shiro:hasPermission="report:report:add">检测管理 > 修改检测报告</small>
                </div>

                <div class="ibox-content">
                    <form  id="form-add"  enctype="multipart/form-data">
                    <input name="reportId" id="reportId"  type="hidden" th:value="${id}"/>
                    <!--<div style="text-align: center;">-->
                    <!--<input  type="button"  value="增行" onclick="addFile()" class="btn btn-info tijiao" style="width: 60px" id="Button3" />-->
                    <!--<button type="button" class="btn btn-info tijiao" id="saveImgBtn">保存</button>&nbsp;&nbsp;&nbsp;-->
                    <!--</div>-->
                        <div>
                            <div class="ibox float-e-margins">

                                <div class="ibox-content">

                                    <div class="alert alert-warning">
                                        <p th:each="img:${list}" style="width: 200px;height: 200px;display: inline-block;text-align: left;">
                                        <img th:src="${img.imgSrc}" class="img" style="width: 100%">
                                            <input type="hidden" th:value="${img.reportImgId}" class="reportimgId">
                                         <a href="javascript:delImg();" style="background-color: darkgreen;padding: 5px 20px;color: #fff;border-radius: 6px;" shiro:hasPermission="report:report:remove">删除</a>
                                        </p>
                                    </div>
                                </div>
                                <div class="ibox-content" shiro:hasPermission="report:report:add">
                                    <div class="page-container">
                                        <p>您可以尝试文件拖拽，使用QQ截屏工具，然后激活窗口后粘贴，或者点击添加图片按钮</p>
                                        <div id="uploader" class="wu-example">
                                            <div class="queueList">
                                                <div id="dndArea" class="placeholder">
                                                    <div id="filePicker" class="webuploader-container"><div class="webuploader-pick">点击选择图片</div><div id="rt_rt_1dd05kgq5ram1ub11oug1h4lkm21" style="position: absolute; top: 0px; left: 277.5px; width: 168px; height: 44px; overflow: hidden; bottom: auto; right: auto;"><input type="file" name="files" class="webuploader-element-invisible" multiple="multiple" accept="image/*"><label style="opacity: 0; width: 100%; height: 100%; display: block; cursor: pointer; background: rgb(255, 255, 255);"></label></div></div>
                                                    <p>或将照片拖到这里，单次最多可选300张</p>
                                                </div>
                                                <ul class="filelist"></ul></div>
                                            <div class="statusBar" style="display:none;">
                                                <div class="progress" style="display: none;">
                                                    <span class="text">0%</span>
                                                    <span class="percentage" style="width: 0%;"></span>
                                                </div>
                                                <div class="info">共0张（0B），已上传0张</div>
                                                <div class="btns">
                                                    <div id="filePicker2" class="webuploader-container"><div class="webuploader-pick">继续添加</div><div id="rt_rt_1dd05kgq83cg1et74c91p4tjs96" style="position: absolute; top: 0px; left: 0px; width: 1px; height: 1px; overflow: hidden;"><input type="file" name="files" class="webuploader-element-invisiblef" multiple="multiple" accept="image/*"><label style="opacity: 0; width: 100%; height: 100%; display: block; cursor: pointer; background: rgb(255, 255, 255);"></label></div></div>
                                                    <div class="uploadBtn state-pedding" id="saveImgBtn">开始上传</div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>

                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" th:inline="javascript">
    function getContextPath() {
        var contextRoot = /*[[@{/}]]*/ '';
        if (contextRoot == '/'){
            contextRoot = '';
        }
        return contextRoot;
    }
</script>

<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/plugins/layer/layer.js}"></script>
<script th:src="@{/js/uploadview.js}" th:inline="javascript"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>

<!-- 自定义js -->
<script th:src="@{/js/content.js}"></script>


<script th:src="@{/js/plugins/webuploader/webuploader.min.js}"></script>

<!--<script th:src="@{/js/plugins/demo/webuploader-demo.js}"></script>-->

<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>

<script th:inline="javascript" th:inline="javascript">
    // 添加全局站点信息
    var BASE_URL = 'js/plugins/webuploader';

    var contextRoot = /*[[@{/}]]*/ '';

    function delImg() {
        var reportimgId=$(".reportimgId").val();
        $.ajax({
            url: getContextPath()+"/report/report/deleteImg/"+reportimgId,
            dataType: "json",
            type: "get",
            success: function (data) {
                layer.closeAll('loading');
                if (data.success) {
                    layer.closeAll('loading');
                    layer.msg('删除成功!', {
                        icon: 1,
                        time: 1000
                    }, function () {
                        location.reload();
                    });
                } else {
                    layer.closeAll('loading');
                    layer.msg(data.message, {
                        icon: 1,
                        time: 1000
                    }, function () {
                        location.reload();
                    });
                }
            },
            error: function (xhr, e1, e2) {
                layer.closeAll('loading');
                layer.msg('系统异常，请重试!', {
                    icon: 1,
                    time: 1000
                }, function () {
                    location.reload();
                });
            }
        });
    }
</script>
</body>
</html>
